import React, {Component} from 'react';

class TodoItem extends Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }

  render() {
    const {content} = this.props;
    return (
      <div onClick={this.handleClick} dangerouslySetInnerHTML={{__html: content}}></div>
    );
  }

  handleClick() {
    const {handleClick, index} = this.props;
    handleClick(index);
  }
}

export default TodoItem;